// src/stores/userStore.js
import { defineStore } from "pinia";
import piniaPersistConfig from "../store/index";
import { ref } from "vue";
export const useUserStore = defineStore(
  "user",
  () => {
    const user = ref({});
    const isLogin = ref(false);
    const lastPath = ref("");
    const tabList = ref([]);
    const tabInnerList=ref([])
    const clearInfo = () => {
      user.value = {};
      isLogin.value = false;
      lastPath.value = "";
      tabList.value = [];
      tabInnerList.value = [];
    };
    return {
      user,
      isLogin,
      lastPath,
      tabList,
      tabInnerList,
      clearInfo,
    };
  },
  {
    persist: piniaPersistConfig("webuser"),
  }
);
